import React, { Component,useState } from 'react'
import { Button, Space } from 'antd';
import {Routes,Route} from 'react-router-dom'

/* import store from "@/store" */

const Home =()=>{
    /* const [count,setCount] = useState(store.getState().count)

    const add=()=>{
        store.dispatch({type:"ADD",payload:1})
        setCount(store.getState().count)
    }
    const reduce=()=>{
        store.dispatch({type:"REDUCE",payload:1})
        setCount(store.getState().count)
    } */

    return(
        <div>
            <h2>首页</h2>
            {/* <div>初始值：{count}</div>
            <Button type="primary" onClick={add}>加1</Button>
            <Button type="primary" onClick={reduce}>减1</Button> */}
        </div>
    )
}
const About =()=>{
    return(
        <div>关于</div>
    )
}

export default class Test extends Component {
    render() {
        console.log("这是测试页面")
        return (
            <Routes>
                <Route path='/' element={<Home/>} ></Route>
                <Route path='/about' element={<About/>} ></Route>
            </Routes>
        )
    }
}
